{extend name="public/container"}
{block name="content"}
<div class="table-responsive" style="overflow:visible">
    <table class="table table-striped  table-bordered">
        <thead>
        <tr>

            <th class="text-center">编号</th>
            <th class="text-center">设备名称</th>
            <th class="text-center">设备编号</th>
            <th class="text-center">wash_state（洗车状态）</th>
            <th class="text-center">water_level（水位）</th>
            <th class="text-center">clean_level（清洗剂的水位）</th>
            <th class="text-center">pwd（密码）</th>
            <th class="text-center">包头</th>
            <th class="text-center">ver_mini（版本低位）</th>
            <th class="text-center" width="10%">ver_high（版本高位）</th>
        </tr>
        </thead>
        <tbody class="">
        <tr>
            <td class="text-center" id="device_id">
                {$vo.id}
            </td>
            <td class="text-center" id="device_name">
                {$vo.device_name}
            </td>
            <td class="text-center" id="device_no">
                {$vo.device_no}
            </td>
            <td class="text-center" id="wash_state">
                {$vo.wash_state}
            </td>
            <td class="text-center" id="water_level">
                {$vo.water_level}
            </td>
            <td class="text-center" id="clean_level">
                {$vo.clean_level}
            </td>
            <td class="text-center" id="pwd">
                {$vo.pwd}
            </td>
            <td class="text-center" id="">

            </td>
            <td class="text-center" id="ver_mini">
                {$vo.ver_mini}
            </td>
            <td class="text-center" id="ver_high">
                {$vo.ver_high}
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script>
    var id = "{$vo.id}";
    var url = "{:url('getData')}";
    setInterval(function () {
        $.ajax({
            type: "GET",
            url: url,
            data:{"id": id},
            dataType: "json",
            success:function (res) {
                var data = res.data.data;
                $("#device_id").text(data.id);
                $("#device_name").text(data.device_name);
                $("#device_no").text(data.device_no);
                $("#wash_state").text(data.wash_state);
                $("#water_level").text(data.water_level);
                $("#clean_level").text(data.clean_level);
                $("#pwd").text(data.pwd);
                $("#ver_mini").text(data.ver_mini);
                $("#ver_high").text(data.ver_high);
            }
        })
    }, 1000)
</script>
{/block}